import storage from 'good-storage'

// 存userid
const USER_ID = '__userid__'

export function saveUserId (userid) {
  storage.set(USER_ID, userid)
}

export function loadUserId () {
  return storage.get(USER_ID)
}

// 存头像
const AVATAR_URL = '__avatarurl__'

export function saveAvatarUrl (avatarurl) {
  storage.set(AVATAR_URL, avatarurl)
}

export function loadAvatarUrl () {
  return storage.get(AVATAR_URL)
}

// 存nickname
const NICK_NAME = '__nickname__'

export function saveNickName (nickname) {
  storage.set(NICK_NAME, nickname)
}

export function loadNickName () {
  return storage.get(NICK_NAME)
}

// 存歌曲播放列表id
const SONG_ID = '__songid__'
export function saveSongId (songid) {
  storage.set(SONG_ID, songid)
}
export function loadSongId () {
  return storage.get(SONG_ID)
}

// 存歌曲名称
const SONG_NAME = '__songname__'
export function saveSongName (songname) {
  storage.set(SONG_NAME, songname)
}
export function loadSongName () {
  return storage.get(SONG_NAME)
}

// 存歌手名
const SINGER_NAME = '__singername__'
export function saveSingerName (singername) {
  storage.set(SINGER_NAME, singername)
}
export function loadSingerName () {
  return storage.get(SINGER_NAME)
}

// 存歌曲封面图片
const SONG_URL = '__songurl__'
export function saveSongUrl (songurl) {
  storage.set(SONG_URL, songurl)
}
export function loadSongUrl () {
  return storage.get(SONG_URL)
}

// 存歌词
const LYRIC_WORD = '__lyricword__'
export function saveLyricWord (lyricword) {
  storage.set(LYRIC_WORD, lyricword)
}
export function loadLyricWord () {
  return storage.get(LYRIC_WORD)
}

// 存mv的封面（用于mv播放）
const MV_COVER = '__mvcover__'
export function saveMvCover (mvcover) {
  storage.set(MV_COVER, mvcover)
}
export function loadMvCover () {
  return storage.get(MV_COVER)
}
